import { LOGIN_TOKEN, CLEAR_USER } from '../actionsType'
import { getToken } from '../../utils/storage'
const initValue = {
  token: getToken()
}
export default function login (state = initValue, action) {
  switch (action.type) {
    case LOGIN_TOKEN:
      return action.payload
    case CLEAR_USER:
      return state
    default:
      return state
  }
}
